// N1Math.h: interface for the N1Math class.
//
//////////////////////////////////////////////////////////////////////

#ifndef N1MATH_H__E406
#define N1MATH_H__E406

#include "N0Lib.h"

#define N1Max(a, b) ((a)>(b)?(a):(b))
#define N1Min(a, b) ((a)<(b)?(a):(b))

template<typename T>
void N1SortValues(T &a, T &b)
{
    if(b<a)
    {
        T tmp = a;
        a = b;
        b = tmp;
    }
}

uint32 N1GetNewSizeByLog2(uint32 currentSize, 
                          uint32 needToAdd, 
                          uint32 minSize);

uint32 N1GetNewSizeByLog2(uint32 currentSize, 
                          uint32 needToAdd, 
                          uint32 minSize,
                          uint32 maxGrow);
   
#endif // N1MATH_H__E406
